<template>
  <div class="body">
    <div class="body_left">
      <BaseMenu
        :menuList="bodyLeft"
        :chidrenShow="chidrenShow"
        :chidrenShowTwo="chidrenShowTwo"
        @go="go"
      />
    </div>
    <div class="body_right">
      <!-- <el-card> -->
      <router-view></router-view>
      <!-- </el-card> -->
    </div>
  </div>
</template>

<script>
import BaseMenu from '@/components/baseMenu/baseMenu'

export default {
  name: 'index',
  components: {
    BaseMenu
  },
  data() {
    return {
      bodyLeft: [
        {
          path: 'xiangmuguanli',
          title: '项目管理',
          icon: 'project-management',
          id: '4B1',
          children: [
            {
              path: '/dataManagement/projectManagement/investProjectInfo',
              title: '招商项目信息',
              icon: '',
              id: '4B11'
            },
            {
              path: '/dataManagement/projectManagement/constructProjectInfo',
              title: '建设项目信息',
              icon: '',
              id: '4B12'
            },
            {
              path: '/dataManagement/projectManagement/sectionManagement',
              title: '项目标段管理',
              icon: '',
              id: '4B13'
            },
            {
              path: '/dataManagement/projectManagement/fixedTargetMap',
              title: '固投目标作战图',
              icon: '',
              id: '4B14'
            },
            {
              path: '/dataManagement/projectManagement/investYearPlan',
              title: '投资主体年度计划',
              icon: '',
              id: '4B15'
            }
          ]
        },
        {
          path: 'xiangmuguanli',
          title: '土地管理',
          icon: 'land-management',
          id: '4B2',
          children: [
            {
              path: '/dataManagement/landManagement/landExpropriation',
              title: '土地报征',
              icon: '',
              id: '4B21'
            },
            {
              path: '/dataManagement/landManagement/landSupply',
              title: '土地供应',
              icon: '',
              id: '4B22'
            },
            {
              path: '/dataManagement/landManagement/landDemolition',
              title: '土地拆迁',
              icon: '',
              id: '4B23'
            }
          ]
        },
        {
          path: 'xiangmuguanli',
          title: '科技创新管理',
          icon: 'tech-management',
          id: '4B3',
          children: [
            {
              path: '/dataManagement/technologyManagement/scientificInstitutions',
              title: '科研机构',
              icon: '',
              id: '4B31'
            },
            {
              path: '/dataManagement/technologyManagement/laboratoryManagement',
              title: '科研团队',
              icon: '',
              id: '4B36'
            },
            {
              path: '/dataManagement/technologyManagement/incubateEnterprises',
              title: '孵化企业',
              icon: '',
              id: '4B32'
            },
            {
              path: '/dataManagement/technologyManagement/centerPlatform',
              title: '中试平台',
              icon: '',
              id: '4B33'
            },
            // {
            //   path: '/dataManagement/technologyManagement/civilAviationZone',
            //   title: '民航示范区',
            //   icon: '',
            //   id: '4B34'
            // },
            {
              path: '/dataManagement/technologyManagement/gatherTalents',
              title: '人才聚集',
              icon: '',
              id: '4B35'
            },
            {
              path: '/dataManagement/technologyManagement/universityCollaboration',
              title: '校地合作',
              icon: '',
              id: '4B37'
            }
          ]
        },
        {
          path: 'qiyeguanli',
          title: '企业管理',
          icon: 'enterprise-target',
          id: '4B-4',
          children: [
            {
              path: '/dataManagement/enterpriseManagement/enterpriseInfo',
              title: '企业信息管理',
              icon: '',
              id: '4B40'
            },
            {
              path: '/dataManagement/enterpriseManagement/enterpriseEconomic',
              title: '企业经济指标',
              icon: '',
              id: '4B4'
            },
            {
              path: '/dataManagement/enterpriseManagement/foreignInvestment',
              title: '外商直接投资额(FDI)',
              icon: '',
              id: '4B41'
            }
          ]
        },
        {
          path: '/dataManagement/importantGoal',
          title: '重要目标',
          icon: 'important-goal',
          id: '4B5'
        },
        {
          path: '/dataManagement/importantEvent',
          title: '重要事件',
          icon: 'important-event',
          id: '4B6'
        },
        {
          path: '/dataManagement/leaderApprove',
          title: '领导批交办',
          icon: 'ldpjb',
          id: '4B7'
        },
        {
          path: 'xiangmuguanli',
          title: '载体去化',
          icon: 'ztqh',
          id: '4B8',
          children: [
            {
              path: '/dataManagement/carrierReduction/parkManagement',
              title: '园区管理',
              icon: '',
              id: '4B81'
            },
            {
              path: '/dataManagement/carrierReduction/industrialCarrier',
              title: '产业载体',
              icon: '',
              id: '4B82'
            },
            {
              path: '/dataManagement/carrierReduction/commercialVehicle',
              title: '商业载体',
              icon: '',
              id: '4B83'
            },
            {
              path: '/dataManagement/carrierReduction/commercialHouse',
              title: '商品房',
              icon: '',
              id: '4B84'
            }
          ]
        },
        {
          path: '/dataManagement/revenueProfit',
          title: '集团营收利润',
          icon: 'yslrjtz',
          id: '4B9'
        },
        {
          path: '/dataManagement/equityInvestment',
          title: '股权投资',
          icon: 'gqtz',
          id: '4B10'
        },
        {
          path: '/dataManagement/industryFund',
          title: '产业基金',
          icon: 'cyjj',
          id: '4Bb1'
        },
        {
          path: '/dataManagement/fileManagement',
          title: '文件管理',
          icon: 'wjgl',
          id: '4Ba1'
        }
      ],
      chidrenShow: true,
      chidrenShowTwo: false
    }
  },
  computed: {
    routerPath() {
      return this.$route.path
    }
  },
  methods: {
    // 路由跳转
    go(path) {
      if (path.indexOf('/wisdomLand') > -1) {
        this.$router.push(path)
        this.chidrenShow = false
      } else if (path === 'rizhi') {
        this.chidrenShowTwo = !this.chidrenShowTwo
      } else if (path.indexOf('/dataManagement') > -1) {
        // 处理dataManagement路径，添加from=menu标记
        this.$router.push({
          path: path,
          query: { from: 'menu' }
        })
      }
    }
  }
}
</script>

<style scoped lang="scss">
.body {
  color: #000;
  height: calc(100vh - 60px);
  width: 100%;
  display: flex;

  &_left {
    width: 296px;
    height: 100%;
    overflow-y: auto;

    .item {
      width: 100%;
      height: auto;
      text-align: left;
      // padding-left: 22px;
      font-size: 14px;
      font-family: PingFang SC;
      font-weight: 500;
      color: #4c565c;
      line-height: 50px;

      :hover {
        cursor: pointer;
      }
    }

    .activeItem {
      //background: red;
      background: rgba(234, 245, 253, 1);
      border-right: 3px solid #4a80a3;
      color: #497fa3;
      //color: #EAF5FD;
    }
  }

  &_right {
    display: flex;
    width: calc(100% - 296px);
    height: 100%;
    background: #eff3f9;

    .el-card {
      width: 100%;
      margin: 15px;
    }
  }
}

::v-deep(.el-input input::-webkit-outer-spin-button),
::v-deep(.el-input input::-webkit-inner-spin-button) {
  -webkit-appearance: none;
  margin: 0;
}

::v-deep(.el-input input[type='number']) {
  -moz-appearance: textfield;
}

::v-deep(.el-input input[type='number']) {
  padding-left: 4px;
  padding-right: 4px;
}
</style>
